﻿// Inner Fire 游戏引擎库
// LabelInfo - 用于文本的Prefab
//
// Copyright (c) 2025 by 尔西大帝. All rights reserved.
//
// 用于文本的Prefab
//
// Author: 尔西大帝
// Email: 2670613871@qq.com
// Created: 2025-04-24

#pragma once

#include <dx/ui/ui_def.h>
#include <memory>
#include <static_string.h>
#include <xml_reader.h>

namespace ifire::ui {

class LabelInfo : public XmlInfo {
public:
  LabelInfo(const XmlNode& node, int index = 0)
    : XmlInfo(node, index)
    , text(node("Text"))
    , capacity(node("Capacity"))
    , text_align(dx::UIAlign::GetAlign(node("TextAlign")))
    , font_size(node("FontSize"))
    , text_padding(node("TextPadding"))
    , font(node("Font"))
    , widget(node) {}
  LabelInfo(const LabelInfo& lhs) = delete;
  LabelInfo& operator=(const LabelInfo& lhs) = delete;
  ~LabelInfo() = default;

public:
  std::string text;
  size_t capacity;
  dx::UIAlign text_align;
  float font_size;
  float text_padding;
  std::string font;
  dx::UIWidget widget;
};
using LabelInfoPtr = std::unique_ptr<LabelInfo>;

}; // namespace ifire::ui